<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>登入</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="https://www.layuicdn.com/layui-v2.6.5/css/layui.css">
    <style>
        html,body,#LAY_app{height:100%;}
        .layui-layout-body{overflow: auto;}

        #LAY-user-login,
        .layadmin-user-display-show{display: block !important;}
        .layadmin-user-login{position: relative; left: 0; top: 0; padding: 110px 0; min-height: 100%; box-sizing: border-box;}
        .layadmin-user-login-main{width: 375px; margin: 0 auto; box-sizing: border-box;}
        .layadmin-user-login-box{padding: 20px;}
        .layadmin-user-login-header{text-align: center;}
        .layadmin-user-login-header h2{margin-bottom: 10px; font-weight: 300; font-size: 30px; color: #000;}
        .layadmin-user-login-header p{font-weight: 300; color: #999;}

        .layadmin-user-login-body .layui-form-item{position: relative;}
        .layadmin-user-login-icon{position: absolute; left: 1px; top: 1px; width: 38px; line-height: 36px; text-align: center; color: #d2d2d2;}
        .layadmin-user-login-body .layui-form-item .layui-input{padding-left: 38px;}
        .layadmin-user-login-codeimg{max-height: 38px; width: 100%; cursor: pointer; box-sizing: border-box;}

        .layadmin-user-login-other{position: relative; font-size: 0; line-height: 38px; padding-top: 20px;}
        .layadmin-user-login-other>*{display: inline-block; vertical-align: middle; margin-right: 10px; font-size: 14px;}
        .layadmin-user-login-other .layui-icon{position: relative; top: 2px; font-size: 26px;}
        .layadmin-user-login-other a:hover{opacity: 0.8;}

        .layadmin-user-jump-change{float: right;}

        .layadmin-user-login-footer{position: absolute; left: 0; bottom: 0; width: 100%; line-height: 30px; padding: 20px; text-align: center; box-sizing: border-box; color: rgba(0,0,0,.5)}
        .layadmin-user-login-footer span{padding: 0 5px;}
        .layadmin-user-login-footer a{padding: 0 5px; color: rgba(0,0,0,.5);}
        .layadmin-user-login-footer a:hover{color: rgba(0,0,0,1);}

        /* 有背景图时 */
        .layadmin-user-login-main[bgimg]{background-color: #fff; box-shadow: 0 0 5px rgba(0,0,0,0.05);}

        /* 主题背景 */
        .ladmin-user-login-theme{position: fixed; bottom: 0; left: 0; width: 100%; text-align: center;}
        .ladmin-user-login-theme ul{display: inline-block; padding: 5px; background-color: #fff;}
        .ladmin-user-login-theme ul li{display: inline-block; vertical-align: top; width: 64px; height: 43px; cursor: pointer; transition: all .3s; -webkit-transition: all .3s; background-color: #f2f2f2;}
        .ladmin-user-login-theme ul li:hover{opacity: 0.9}

        @media screen and (max-width: 768px) {
            .layadmin-user-login{padding-top: 60px;}
            .layadmin-user-login-main{width: 300px;}
            .layadmin-user-login-box{padding: 10px;}
        }
    </style>
</head>
<body>

<div class="layadmin-user-login layadmin-user-display-show" id="LAY-user-login" style="display: none;">

    <div class="layadmin-user-login-main">
        <div class="layadmin-user-login-box layadmin-user-login-header">
            <h2>用户验证</h2>
            <p> </p>
        </div>
        <div class="layadmin-user-login-box layadmin-user-login-body layui-form">
            <div class="layui-form-item">
                <label class="layadmin-user-login-icon layui-icon layui-icon-password" for="LAY-user-login-password"></label>
                <input type="password" name="password" id="LAY-user-login-password" lay-verify="required" placeholder="密码" class="layui-input">
            </div>
            <div class="layui-form-item" style="margin-bottom: 20px;">
                <input type="checkbox" name="remember" lay-skin="primary" title="记住密码">
                <a href="forget.html" class="layadmin-user-jump-change layadmin-link" style="margin-top: 7px;">忘记密码？</a>
            </div>
            <div class="layui-form-item">
                <button class="layui-btn layui-btn-fluid" lay-submit lay-filter="LAY-user-login-submit">登 入</button>
            </div>
        </div>
    </div>

    <div class="layui-trans layadmin-user-login-footer">

        <p>© 2018</p>

    </div>

<!--<div class="ladmin-user-login-theme">
      <script type="text/html" template>
        <ul>
          <li data-theme=""><img src="@{{ layui.setter.base }}style/res/bg-none.jpg"></li>
          <li data-theme="#03152A" style="background-color: #03152A;"></li>
          <li data-theme="#2E241B" style="background-color: #2E241B;"></li>
          <li data-theme="#50314F" style="background-color: #50314F;"></li>
          <li data-theme="#344058" style="background-color: #344058;"></li>
          <li data-theme="#20222A" style="background-color: #20222A;"></li>
        </ul>
      </script>
    </div>-->

</div>

<script src="https://www.layuicdn.com/layui-v2.6.5/layui.js"></script>
<script>
    layui.use(['form','layer'], function(){
        var $ = layui.$
            ,form = layui.form
            ,layer = layui.layer

        //提交
        form.on('submit(LAY-user-login-submit)', function(obj){

            $.post('/login',obj.field,function (res) {

                if (res.code === 0){

                    window.location.href = '/home';
                }else {

                    layer.msg(res.msg);
                }
            })

        });

    });
</script>
</body>
</html>
